package com.common.repository.system;


import com.common.entity.system.DictionaryEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;


/**
 * @author johnny
 */
public interface DictionaryRepository extends JpaSpecificationExecutor<DictionaryEntity>, JpaRepository<DictionaryEntity, Long> {
    /**
     * 根据名称查找数据
     *
     * @param name
     * @return
     */
    DictionaryEntity findByName(String name);

    List<DictionaryEntity> findByType(String type);


    DictionaryEntity findByNameAndType(String name, String type);

    DictionaryEntity findByValueAndType(String value, String type);


    List<DictionaryEntity> findByTypeOrderBySortNumAsc(String type);


}
